package com.beautiful.xin.other;

import com.google.common.collect.Sets;

import java.util.HashSet;

/**
 * @author xuqingxin 2021/7/25 11:45 上午
 */
public class StringTypesTest {
    public static void main(String[] args) {

        String[] strings1 = {"aas", "dsfa", "aas"};
        int types = types(strings1);
        System.out.println(types);

    }

    public static int types(String[] arr) {
        HashSet<Integer> types = Sets.newHashSet();
        for (String str : arr) {
            int key = 0;
            char[] chars = str.toCharArray();

            for (int i = 0; i < chars.length; i++) {
                key |= 1 << (chars[i] - 'a');
            }
            types.add(key);
        }
        return types.size();
    }
}
